-
Notifications
You must be signed in to change notification settings - Fork 5
react native 82 file changes #134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-11-07.at.17.06.21.mp4 |
iBotPeaches
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concerned since there is no change outside of the /example folder that this change will not be resolved - #133
Please review the library upgrade to RN82 as well as the example app.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR upgrades React Native from version 0.76.7/0.80.0 to 0.82.0, updating dependencies across the project and example app. The changes include modifications to permission handling logic, test mocking strategies, and build configurations for both iOS and Android platforms.
Key changes:
- Updated React Native and related dependencies to version 0.82.0
- Modified permission handling to return raw result instead of boolean comparison
- Refactored test mocks to use simplified React Native module mocking
- Updated example app to use
react-native-safe-area-contextlibrary
Reviewed Changes
Copilot reviewed 16 out of 20 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Updated React Native and related dependencies from 0.76.7 to 0.82.0, added babel preset and transform ignore patterns |
| example/package.json | Updated example app dependencies to 0.82.0, added safe-area-context library, updated Node engine requirement to >=20 |
| src/handlePermissions.tsx | Changed return value from boolean comparison to raw permission result |
| src/tests/handlePermissionsGranted.test.tsx | Simplified mock structure, changed mock return to boolean true |
| src/tests/handlePermissionsDenied.test.tsx | Simplified mock structure, changed mock return to boolean false |
| example/src/App.tsx | Refactored to use SafeAreaProvider and SafeAreaView from external library, added AppWrapper component |
| example/ios/Podfile.lock | Updated all React Native iOS dependencies from 0.80.0 to 0.82.0 |
| example/android/build.gradle | Updated build tools and SDK versions to 36 |
| example/android/gradle/wrapper/gradle-wrapper.properties | Updated Gradle from 8.14.1 to 9.0.0 |
| example/android/app/src/main/java/.../MainApplication.kt | Simplified ReactHost initialization using new API pattern |
| tsconfig.json | Added exclude paths for example, lib, and node_modules |
| babel.config.js | Added TypeScript and Flow presets with test environment configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ); | ||
|
|
||
| return granted === PermissionsAndroid.RESULTS.GRANTED; | ||
| return granted; |
Copilot
AI
Nov 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change from return granted === PermissionsAndroid.RESULTS.GRANTED to return granted introduces a breaking API change. The function previously returned a boolean, but now returns a PermissionStatus string ('granted', 'denied', 'never_ask_again'). This will break existing code that expects a boolean. Consider either: (1) keeping the boolean comparison for backward compatibility, or (2) explicitly documenting this as a breaking change with migration guidance.
| return granted; | |
| return granted === PermissionsAndroid.RESULTS.GRANTED; |
| GRANTED: 'granted', | ||
| DENIED: 'denied', | ||
| }, | ||
| request: jest.fn(() => Promise.resolve(true)), |
Copilot
AI
Nov 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The mock returns true (a boolean), but PermissionsAndroid.request() in React Native 0.82 returns a PermissionStatus string ('granted', 'denied', or 'never_ask_again'), not a boolean. The mock should return Promise.resolve('granted') to accurately reflect the actual API behavior.
| request: jest.fn(() => Promise.resolve(true)), | |
| request: jest.fn(() => Promise.resolve('granted')), |
| GRANTED: 'granted', | ||
| DENIED: 'denied', | ||
| }, | ||
| request: jest.fn(() => Promise.resolve(false)), |
Copilot
AI
Nov 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The mock returns false (a boolean), but PermissionsAndroid.request() in React Native 0.82 returns a PermissionStatus string ('granted', 'denied', or 'never_ask_again'), not a boolean. The mock should return Promise.resolve('denied') to accurately reflect the actual API behavior.
| request: jest.fn(() => Promise.resolve(false)), | |
| request: jest.fn(() => Promise.resolve('denied')), |
My changes:
Android Testing.webm
